import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/server-system/admin/schedule/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getLogList = (current, size, params) => {
  return request({
    url: '/api/server-system/admin/schedule/log/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (jobId) => {
  return request({
    url: '/api/server-system/admin/schedule/info',
    method: 'get',
    params: {
      jobId
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/server-system/admin/schedule/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/server-system/admin/schedule/save',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/server-system/admin/schedule/update',
    method: 'post',
    data: row
  })
}

export const run = (ids) => {
  return request({
    url: '/api/server-system/admin/schedule/run',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const pause = (ids) => {
  return request({
    url: '/api/server-system/admin/schedule/pause',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const resume = (ids) => {
  return request({
    url: '/api/server-system/admin/schedule/resume',
    method: 'post',
    params: {
      ids,
    }
  })
}


